﻿using Coldairarrow.Entity.DTO;
using Coldairarrow.Entity.TD;
using Coldairarrow.Util;
using Coldairarrow.Util.ClassLibrary;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Coldairarrow.Business.TD
{
    public partial interface ITD_InStorageBusiness
    {
        
        Task<TD_InStorage> GetTheDataAsync(string id);
        Task AddDataAsync(TD_InStorage data);
        Task UpdateDataAsync(TD_InStorage data);
        Task DeleteDataAsync(List<string> ids);
        /// <summary>
        /// 打印完工入库
        /// </summary>
        /// <param name="ParentId"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<TD_InStorageinfo> GetTD_InStorageinfo(string ParentId);
        Task<PageResultData<inStorDetailDto>> inStorDetailDetail(PageInput<ProjectSummaryContionDTO> input);

        /// <summary>
        /// 获取无码入库单的明细
        /// </summary>
        /// <param name="InStorageId">入库单Id</param>
        /// <returns></returns>
        Task<List<NoCodeInStorageDetailDTO>> GetInStorageDetailListAsync(string InStorageId);

        /// <summary>
        /// 无码入库单打印条码
        /// </summary>
        /// <param name="data"></param>
        /// <param name="_mongodbOptions">mongo数据库连接</param>
        /// <returns></returns>
        Task PrintNoCodeInStorageDetailDataAsync(NoCodeInStorageDetailData data, MongoDBOptions _mongodbOptions);

    }
  
    public class TD_InStorageQM
    {
        /// <summary>
        /// 入库单号
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 入库类型
        /// </summary>
        public string InType { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public int? Status { get; set; }
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? InStorTimeStart { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? InStorTimeEnd { get; set; }
        public string Rukuid { get; set; }
        /// <summary>
        /// 物料
        /// </summary>
        public string MaterialName { get; set; }
        /// <summary>
        /// 货区
        /// </summary>
        public string LocalName { get; set; }
        /// <summary>
        /// 制单人
        /// </summary>
        public string ConfirmUserIdName { get; set; }

        public string Type { get; set; }
    }
    public class TD_InStoragePageInput : PageInput<TD_InStorageQM>
    {
        public string StorId { get; set; }

        /// <summary>
        /// 入库类型
        /// </summary>
        public string Type { get; set; }
    }

    /// <summary>
    /// 无码入库明细
    /// </summary>
    public class NoCodeInStorageDetailDTO : TD_InStorDetail
    {
        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }

        /// <summary>
        /// 物料规格
        /// </summary>
        public string MaterialSpec { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string MaterialCode { get; set; }

        /// <summary>
        /// 是否是成品
        /// </summary>
        public Boolean? IsProduct { get; set; }

        /// <summary>
        /// 成品编码
        /// </summary>
        public string ProductCode { get; set; }

        /// <summary>
        /// 打印数量
        /// </summary>
        public Double? PrintNums { get; set; }

        /// <summary>
        /// 是否是标准件
        /// </summary>
        public Boolean? IsStandard { get; set; }

    }

    public class NoCodeInStorageDetailData
    {
        /// <summary>
        /// 打印明细
        /// </summary>
        public List<NoCodeInStorageDetailDTO> noCodeInStorageDetailDTOs { get; set; }

        /// <summary>
        /// 打印机Id
        /// </summary>
        public string PrinterId { get; set; }

    }

}